#include <stdio.h>
#include <stdlib.h>
#include <iostream>
using namespace std;

class Nodo{
  int id;
  Nodo* father;
  public:
  Nodo();
  ~Nodo();
  Nodo(int id, Nodo* f);
  int get_id()const;
  Nodo* get_father()const;
  void set_id(int i);
  void set_father(Nodo* f);
  void set(int i, Nodo* f);
  void toString()const;
};

Nodo::Nodo(){
  id = 0;
  father = NULL;
}

Nodo::Nodo(int id, Nodo* f){
  id = id;
  father = f;
}

int Nodo::get_id()const{
  return id;
}

Nodo* Nodo::get_father()const{
  return father;
}

void Nodo::set_id(int i){
  id = i;
}

void Nodo::set_father(Nodo* f){
  father = f;
}

void Nodo::set(int i, Nodo* f){
  id = i;
  father = f;
}

void Nodo::toString()const{
  cout << "id: " << id << " father: " << father << endl;
}

Nodo::~Nodo(){
}

int main(){
  Nodo n1(1, NULL);
  Nodo n2;
  Nodo n3;
  Nodo n4;

  n3.set(3, &n1);
  n4.set(4, &n3);

  n1.toString();
  n2.toString();
  n3.toString();
  n4.toString();

  return 0;
}
